package com.nulstudio.sppm.entity;

import java.util.Objects;
public final class Customer {
    private final int id;
    private final String name, type, phone, address, notes;

    public Customer(int id, String name, String type, String phone, String address, String notes) {
        this.id = id;
        this.name = name;
        this.type = type;
        this.phone = phone;
        this.address = address;
        this.notes = notes;
    }

    public Customer(){
        this.id = 0;
        this.name = null;
        this.type = null;
        this.phone = null;
        this.address = null;
        this.notes = null;
    }

    public int getId() {return id;}

    public String getName() {return name;}

    public String getType() {return type;}

    public String getPhone() {return phone;}

    public String getAddress() {return address;}

    public String getNotes() {return notes;}

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Customer customer = (Customer) o;
        return id == customer.id && Objects.equals(name, customer.name) && Objects.equals(type, customer.type) && Objects.equals(phone, customer.phone) && Objects.equals(address, customer.address) && Objects.equals(notes, customer.notes);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, name, type, phone, address, notes);
    }
}
